/*
 * @Author: your name
 * @Date: 2021-11-09 16:30:21
 * @LastEditTime: 2021-12-28 14:22:55
 * @LastEditors: Please set LastEditors
 * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 * @FilePath: \li-yuwei\egg-example\app\router.js
 */
"use strict";

/**
 * @param {Egg.Application} app - egg application
 */
module.exports = (app) => {
    const { router, controller } = app;
    router.get("/insert", controller.housing.insert);

    /* 管理端 */
    /* 管理端 */
    /* 管理端 */

    //---房源管理---/

    //获取房源列表
    router.get("/housing", controller.housing.getHousingList);
    //添加
    router.post("/housing", controller.housing.addHousingList);
    //删除
    router.delete("/housing/:id", controller.housing.delHousingList);
    //修改
    router.put("/housing", controller.housing.editHousingList);
    //修改
    router.put("/housing/state", controller.housing.changeHousingState);
    //指派经纪人
    router.put("/housing/broker", controller.housing.designBroker);
    //---经纪人管理----/

    //获取经纪人信息
    router.get("/broker", controller.broker.getBrokerList);
    //搜索
    router.get("/search/broker", controller.broker.searchBrokerList);
    //删除
    router.delete("/broker/:id", controller.broker.delBrokerList);
    //添加
    router.post("/broker", controller.broker.addBrokerList);
    //编辑
    router.put("/broker", controller.broker.editBrokerList);
    //启用
    router.put("/start/broker/:id", controller.broker.startBrokerState);
    //禁用
    router.put("/stop/broker/:id", controller.broker.stopBrokerState);
    //获取验证码
    router.post("/vCode/broker", controller.broker.getBrokerVCode);
    //获取个人经纪人信息
    router.get("/info/broker", controller.broker.getBrokerInfo);
    //---团购管理-----//

    //获取
    router.get("/grouplist", controller.group.getGroupList);
    //搜索
    router.get("/grouplist/search", controller.group.searchGroupList);
    //删除
    router.delete("/grouplist/:id", controller.group.delGroupList);
    //改变state状态
    router.put("/grouplist", controller.group.changeGroupState);
    //改变开团状态
    router.put("/change/grouplist", controller.group.changeOpenState);

    //---公司-----//
    router.get("/company", controller.company.getCompanyList);
    //---户型-----//
    router.get("/housetype", controller.housetype.getHouseTypeList);
    //---订单类型----//
    router.get("/ordertype", controller.ordertype.getOrderTypeList);
    //---审核管理----//

    //获取
    router.get("/audit", controller.audit.getAuditList);
    //搜索
    router.get("/search/audit", controller.audit.searchAuditList);
    //删除
    router.delete("/audit/:id", controller.audit.delAuditList);
    //编辑
    router.put("/audit", controller.audit.editAuditList);
    //改变审核状态
    router.put("/state/audit", controller.audit.changeAuditState);

    //----咨询管理----//
    //获取列表
    router.get("/information", controller.information.getInformationList);
    //搜索
    router.get("/search/information", controller.information.searchInformationList);
    //删除
    router.delete("/information/:id", controller.information.delInformationList);
    //修改状态
    router.put("/information/:id", controller.information.changeInformationState);
    //编辑
    router.put("/information", controller.information.editInformationList);
    //新增
    router.post("/information", controller.information.addInformationList);

    //----订单管理----//
    //获取
    router.get("/order", controller.order.getOrderList);
    //搜索
    router.get("/search/order", controller.order.searchOrderList);
    //删除
    router.delete("/order/:id", controller.order.delOrderList);

    //----求租----//

    //获取筛选类型信息
    router.get("/property", controller.property.getPropertyList);
    //获取
    router.get("/demand", controller.demand.getDemandList);
    //搜索
    router.get("/search/demand", controller.demand.searchDemandList);
    //----求购----//
    //获取
    router.get("/askbuy", controller.askbuy.getAskBuyList);
    //搜索
    router.get("/search/askbuy", controller.askbuy.searchAskBuyList);

    //----楼市圈----//

    //获取
    router.get("/housingring", controller.housingring.getHousingRingList);
    //删除
    router.delete("/housingring/:id", controller.housingring.delHousingRingList);
    //发布
    router.post("/housingring", controller.housingring.publicHousingRingList);
};